<xsl:stylesheet version="1.0" xmlns="urn:hl7-org:v3" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sdtc="urn:hl7-org:sdtc" xmlns:isc="http://extension-functions.intersystems.com" xmlns:exsl="http://exslt.org/common" xmlns:set="http://exslt.org/sets" exclude-result-prefixes="isc sdtc exsl set">
	<xsl:template match="/location/healthCareFacility/serviceProviderOrganization"> 
					<RelatedObjectIds> 
						<xsl:apply-templates select="asOrganizationPartOf/wholeOrganization" /> 
					</RelatedObjectIds> 
	</xsl:template> 
	
	<xsl:template match="asOrganizationPartOf/wholeOrganization">
		<value name="{name}" />
		<xsl:for-each select="asOrganizationPartOf/wholeOrganization"> 
			<value name="{name}" />
			<xsl:apply-templates select="asOrganizationPartOf/wholeOrganization" />
		</xsl:for-each> 
	</xsl:template>
</xsl:stylesheet>
